Skip to content

✨ Add unary_plus#308

Merged
bdeane-intel merged 1 commit intointel:mainfrom
elbeno:add-unary-plus
Jan 5, 2026
Merged

✨ Add unary_plus#308
bdeane-intel merged 1 commit intointel:mainfrom
elbeno:add-unary-plus

Conversation

@elbeno
Copy link
Contributor

@elbeno elbeno commented Jan 2, 2026

Problem:

  • The standard does not provide a function object that calls unary operator+. This can be useful for conventional conversions, for example an overloaded operator+ that converts an scoped enumeration to its underlying type.

Solution:

  • Add unary_plus for this purpose.
  • unary_plus<void> deduces its argument and provides is_transparent in accordance with standard practice.

Problem:
- The standard does not provide a function object that calls unary `operator+`.
  This can be useful for conventional conversions, for example an overloaded
  `operator+` that converts an scoped enumeration to its underlying type.

Solution:
- Add `unary_plus` for this purpose.
- `unary_plus<void>` deduces its argument and provides `is_transparent` in
  accordance with standard practice.
@bdeane-intel bdeane-intel merged commit 44e1790 into intel:main Jan 5, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants